﻿using Infrastructure.Model;
using Model;
using Repositories.IRepositories;
using Services.IServices;

namespace Services.Services
{
    [AppService(ServiceType = typeof(IUserServices), ServiceLifetime = LifeTime.Transient)]
    public class UserServices : IUserServices
    {
        private readonly IUserRepository userRepository;
        public UserServices(IUserRepository _userRepository)
        {
            userRepository = _userRepository;
        }
        /// <summary>
        /// 登录验证
        /// </summary>
        /// <param name="loginBody"></param>
        /// <returns></returns>
        //public User Login(int LoginID, string LoginPassWord)
        //{
        //    //密码md5

        //    User user = _userRepository.Query(L);

        //    if (user == null)
        //    {
        //        throw new Exception("用户名或密码错误");
        //    }
        //    return user;
        //}

        public List<User> GetStudent()
        {
            return userRepository.GetAll();
        }

        public User GetFirst(int LoginID, string LoginPassWord)
        {
            throw new NotImplementedException();
        }

        int IUserServices.Add(User user)
        {
            throw new NotImplementedException();
        }

        public List<User> GetAll()
        {
            throw new NotImplementedException();
        }

        public User Login(int LoginID, string LoginPassWord)
        {
            throw new NotImplementedException();
        }
    }
}
